<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
<title>漂亮的响应式Bootstrap后台管理系统模板MatAdmin</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/bootstrap.min.css" />
<!-- <link rel="stylesheet" href="/phpwmscm/PUBLIC/css/bootstrap-responsive.min.css" />-->
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/fullcalendar.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/matrix-style.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/matrix-media.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/index.css" />
<link href="/phpwmscm/PUBLIC/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/jquery.gritter.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<script src="/phpwmscm/PUBLIC/js/jquery-1.8.0.min.js"></script> 
    <style type="text/css">
		#allmap{width:100%;height:550px;}
	</style>
	<style>
        html, body, #container {
            height: 100%;
            width: 100%;
        }

        .amap-icon img,
        .amap-marker-content img{
            width: 25px;
            height: 34px;
        }

        .marker {
            position: absolute;
            top: -20px;
            right: -118px;
            color: #fff;
            padding: 4px 10px;
            box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
            white-space: nowrap;
            font-size: 12px;
            font-family: "";
            background-color: #25A5F7;
            border-radius: 3px;
        }

        .input-card{
            width: 18rem;
            z-index: 170;
        }

        .input-card .btn{
            margin-right: .8rem;
        }

        .input-card .btn:last-child{
            margin-right: 0;
        }
    </style>
   
<style>

.parent {
	display: block;
	background: gray;
}

.parent {
	 writing-mode: horizontal-tb; 
}

.child {
	margin: 10px 10px 10px 10px;
	border: 5px solid black;
	padding: 5px;
	width: 350px;
	height: 600px;
	text-align: center;
	background: lightblue;
	writing-mode: horizontal-tb;
	display: inline-block;
}
</style>
<!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hNx4DUGHj4NRfZZIlfmSkkaxpwe1r8Zj"></script> -->
<!-- <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=9236cca4395c6f2a6e7dbd58677501c5"></script>  -->  
</head>
<body>
        
<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">MatAdmin</a></h1>
</div>
<!--close-Header-part-->
<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
    <li  class="dropdown" id="profile-messages" ><a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span id="userbeifn" class="text"><?php echo ($user); ?></span><b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a href="#"><i class="icon-user"></i> 我的资料</a></li>
        <li class="divider"></li>
        <li><a href="#"><i class="icon-check"></i> 我的任务</a></li>
        <li class="divider"></li>
        <li><a href="<?php echo U('Login/logout');?>"><i class="icon-key"></i> 退出</a></li>
      </ul>
    </li>
    <li class="dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">消息</span> <span class="label label-important">5</span> <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a class="sAdd" title="" href="#"><i class="icon-plus"></i> 新消息</a></li>
        <li class="divider"></li>
        <li><a class="sInbox" title="" href="#"><i class="icon-envelope"></i> 收件箱</a></li>
        <li class="divider"></li>
        <li><a class="sOutbox" title="" href="#"><i class="icon-arrow-up"></i> 发件箱</a></li>
        <li class="divider"></li>
        <li><a class="sTrash" title="" href="#"><i class="icon-trash"></i> 发送</a></li>
      </ul>
    </li>
    <li class=""><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">设置</span></a></li>
    <li class=""><a title="" href="<?php echo U('Login/logout');?>"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
  </ul>
</div>
<!--close-top-Header-menu-->
<!--start-top-serch-->
<div id="search">
  <input type="text" placeholder="输入搜索内容..."/>
  <button type="submit" class="tip-bottom" title="Search"><i class="icon-search icon-white"></i></button>
</div>
<!--close-top-serch-->
<div id="sidebar"><a href="#" class="visible-phone"><i class="icon-home"></i> 控制台</a>
  <ul>
   <!--  <li><a href="<?php echo U('Index/index');?>"><i class="icon-home"></i> <span>首页</span></a> </li>
    <li class="active"> <a href="<?php echo U('Log/index');?>"><i class="icon-signal"></i> <span>司机车牌管理</span></a> </li>
    <li> <a href="<?php echo U('Lsdl/index');?>"><i class="icon-signal"></i> <span>客户门店添加</span></a> </li>
    <li> <a href="<?php echo U('Ls/index');?>"><i class="icon-signal"></i> <span>门店报单编辑</span></a> </li>
    <li> <a href="<?php echo U('Lsrb/index');?>"><i class="icon-signal"></i> <span>已报订单确认</span></a> </li>
    <li> <a href="<?php echo U('Nslsrb/index');?>"><i class="icon-signal"></i> <span>日报新增删除</span></a> </li>
    <li > <a href="<?php echo U('Sc/index');?>"><i class="icon-signal"></i> <span>商超批量派车</span></a> </li>
    <li> <a href="<?php echo U('Scdl/index');?>"><i class="icon-signal"></i> <span>商超独立派车</span></a> </li>
    <li> <a href="<?php echo U('Wpcmd/index');?>"><i class="icon-signal"></i> <span>未派订单处理</span></a> </li> -->
  </ul>
</div>
<!--sidebar-menu-->

<!--main-container-part-->
<div id="content">
<!--breadcrumbs-->
  <div id="content-header">
    <div id="f"> <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a></div>
  </div>
<!-- End-breadcrumbs -->

<!-- Action boxes -->
  <div>
  <div id="wwf" class="">
    <div> 
    <form action="<?php echo U('log/upfile');?>" enctype="multipart/form-data" method="post">
	上传单品编码<input type="file" name="photo" /> <input type="submit" value="提交">
    </form>      
    <form action="<?php echo U('Log/index');?>" enctype="multipart/form-data" method="post">
    <input type=submit class="span2" name=submit id="ceshi1" value=单品编码编辑> 	
    <input type=submit class="span2" name=submit id="ceshi4" value=清除上传文件> 
    <input type=submit class="span2" name=submit id="ceshi5" value=清除保存文件> 
    </form>
    <button id="fbt1" >删除单品</button>	
	<button id="fbt3" >单品新增</button>
	<button id="fbt4" >单品提交</button>	
	</div>
	
	<div id="newwwf" style="overflow:auto;position: relative;" ><!-- 父元素使用相对定位，子元素使用绝对定位，可以实现添加隐藏input不影响滚动条。 -->
                     		<table id=tablea class="table table-bordered table-striped" >							
							<thead>
							
							<tr>								   					  					
								<th><nobr>选中</nobr></th>	
								<th><nobr>单品编码</nobr></th>	
								<th><nobr>品名</nobr></th>
								<th><nobr>单品条码</nobr></th>	
								<th><nobr>单品规格型</nobr></th>
								<th><nobr>箱规</nobr></th>
								<th><nobr>单品保质期</nobr></th>								
								<th><nobr>单品类型</nobr></th>	
								<th><nobr>计数</nobr></th>																																
							</tr>
							
							</thead>
							<tbody>
							<?php if(is_array($arr3)): $i = 0; $__LIST__ = $arr3;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$voa): $mod = ($i % 2 );++$i;?><tr>
							    <th><input type=checkbox value=<?php echo ($voa["id"]); ?>></th>						
								<td><nobr><?php echo ($voa["hpbm"]); ?></nobr></td>	
								<td><nobr><?php echo ($voa["dpmc"]); ?></nobr></td>	
								<td><nobr><?php echo ($voa["sptm"]); ?></nobr></td>
								<td><nobr><?php echo ($voa["dpgg"]); ?></nobr></td>
								<td><nobr><?php echo ($voa["djzlkg"]); ?></nobr></td>
								<td><nobr><?php echo ($voa["dpbzq"]); ?></nobr></td>	
								<th><select>
								<option value =<?php echo ($voa["hwlx"]); ?>><?php echo ($voa["hwlx"]); ?></option>
								<option value =<?php echo ($voa["ew1"]); ?>><?php echo ($voa["ew1"]); ?></option>
								<option value =<?php echo ($voa["ew2"]); ?>><?php echo ($voa["ew2"]); ?></option>
								    </select></th>		
								<td><nobr><?php echo ($voa["js"]); ?></nobr></td>																																
							</tr><?php endforeach; endif; else: echo "" ;endif; ?>	
							</tbody>							
						</table>
    </div>     
           
    </div>
    </div>
<!-- End-Action boxes -->    

</div>

<!--end-main-container-part-->

<!--Footer-part-->

<div class="row-fluid">
  <div id="footer" class="span12">Copyright &copy; 2018.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a> </div>
</div>


<script src="/phpwmscm/PUBLIC/js/excanvas.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.ui.custom.js"></script> 
<script src="/phpwmscm/PUBLIC/js/bootstrap.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.flot.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.flot.resize.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.peity.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/fullcalendar.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.dashboard.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.gritter.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.interface.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.chat.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.validate.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.form_validation.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.wizard.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.uniform.js"></script> 
<script src="/phpwmscm/PUBLIC/js/select2.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.popover.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.dataTables.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.tables.js"></script> 
<script src="/phpwmscm/PUBLIC/js/mindmup-editabletable.js"></script> 
<script src="/phpwmscm/PUBLIC/js/numeric-input-example.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.mousewheel.js"></script>
<!--end-Footer-part-->

<script type="text/javascript">

//ajax 测试
 $.post("/phpwmscm/admin.php/Admin/Log/ceshi/",
		    {
		    
		    },
		    function(data,status){	
		    	
		    	 switch (data) 
		    	{		    	
		        case "1":
		    	{
		       
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsdl/index');?>'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ls/index');?>'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsrb/index');?>'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Dddy/index');?>'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Rkcl/index');?>'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ddgz/index');?>'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	break;
		    	}
		    	
		        case "2":
		      	{       	
$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");		            
$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsdl/index');?>'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>");
$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ls/index');?>'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsrb/index');?>'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>");
$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	
		        break;
		    	}
		    	
		        case "3":
		    	{ 
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Dddy/index');?>'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Rkcl/index');?>'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ddgz/index');?>'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	break;
		    	}
		    	
		        case "4":
		        {    	    	
		        	
		        break;
		        } 
		        
		        default: 
		        {
		    	break;
		        } 
		        
		    	} 
		    	//$("#sidebar").find("li")[0].remove();    
		    });  
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 $.post("/phpwmscm/admin.php/Admin/Log/ajaxddxx/",
		    { 		      
		           
		    },
		    function(data,status){ 	
		    	var j1=$.parseJSON(data);	
		    	//console.log(j1);//配合 var_dump 可以实现对ajax 处理过程的监控。    	
                if(j1.length>1){
                	kgbj=1;
                	for(var ii=1;ii<j1.length;ii++){
                		var newzfc='<tr>'
            			+'<th><input type=checkbox value=a99999></th>'
            	        +'<td>'+j1[ii].dpbm+'</td>'
            	        +'<td>'+j1[ii].pinming+'</td>'
            	        +'<td>'+j1[ii].dptm+'</td>'
            	        +'<td>'+j1[ii].gpgg+'</td>'
            	        +'<td>'+j1[ii].xianggui+'</td>'
            	        +' <td>'+j1[ii].baozhiqi+'</td>'
     		            +'<th><select>'
     		            +'<option value ='+j1[ii].hwlx+'>'+j1[ii].hwlx+'</option>'
     		            +'<option value ='+j1[ii].hwlx1+'>'+j1[ii].hwlx1+'</option>'
     		            +'<option value ='+j1[ii].hwlx2+'>'+j1[ii].hwlx2+'</option>'
     		            +'</select></th>'
     		            +'<td>'+j1[ii].dpbm+'</td></tr>'               	
                	 $('#tablea').children('tbody').append(newzfc);
                	}
         		 $('#tablea').unbind();
         		 $('#tablea').editableTableWidget();
                }
		    });	 	 	 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var act;//这个变量在js中赋值，保存当前表格td焦点。   
$('#tablea').editableTableWidget();     
     //js查找某字符在字符串中出现的次数哦。
     function getStrCount(scrstr,armstr) { //scrstr源字符串  armstr查找字符
    	     var count=0;
    	     while(scrstr.indexOf(armstr) != -1 ) {
    	        scrstr = scrstr.replace(armstr,"")
    	        count++;    
    	     }
    	     return count;
      }
       
    //鼠标滚轮运动事件 
    $('#wwf').mousewheel(function(event, delta) {      
    	
    });
   
  
   //删除
   $('#fbtxxx').click(function(){
		 $.post("/phpwmscm/admin.php/Admin/Log/tjajax1/",
 	 		    { 
 	 		     
 	 		    },
 	 		    function(data,status){
 	 		    	
 	 		    	console.log(data);//配合 var_dump 可以实现对ajax 处理过程的监控。    		    	 		    	
 	 		    });	
 		  
		
	}); 
   $('#ceshi1').click(function(){
	   $('#tablea').remove();
	   //console.log("sdfsdfsdf");
	}); 
    // 删除
    $('#fbt1').click(function(){
     //测试下拉列表框的 html text val	
     //$('select').each(function(){
     //	 alert($(this).val());
     //});
     var  temp2Arr="";//缓存check 
     
     //input:checkbox:checked 选中input下的checkbox的checked选中值。
   	 $('#tablea').find("input:checkbox:checked").each(function(){
   		
     	   var temp=$(this).val();
     	  
   		   temp2Arr=temp2Arr+temp+",";//生成1,2,3这样的id字符串
   		   
   		   $('#tablea').children('tbody').find("tr").each(function(){ 			   
   	      	  if(temp==$(this).find("input:checkbox:checked").val())
   	      	  {   	      	 
   			   $(this).remove();//先找到table的选中复选框值，再用这个值与table表体中每一行tr中的复选框值比对，两个值相同就删除当前行。   			  
   	      	  }
   	      	  });//从表格体中查找tr行，并找到每行中check-box的值。   
   		   
     	   });
   	 var temp2=temp2Arr;//保留逗号，在php中以“a99999,”将它全部清除掉。
  	
   	//console.log(temp2);
   	 $.post("/phpwmscm/admin.php/Admin/Log/tjajaxsjsc/",
  		    { 		      
  		      arr2:temp2, 		     
  		    },
  		    function(data,status){ 	
  		    	
  		    	//console.log(data);//配合 var_dump 可以实现对ajax 处理过程的监控。    		    	 		    	
  		    });	 	 	 
 	 alert("司机删除完成"); 	 
		
	});
    
    //新增
	$('#fbt3').click(function(){
		var kgbj=0
		$('#tablea').children('tbody').find('tr').each(function(){	    	  
	    	if($(this).text()!=""){
	    		kgbj=1;
	    	}
	     }); 
		
		if(kgbj==1){
		 $('#tablea').children('tbody').append('<tr><th><input type=checkbox value=a99999></th><td></td><td></td><td></td><td></td><td></td><td>360</td>'
		            +'<th><select>'
		            +'<option value ="冻货">冻货</option>'
		            +'<option value ="鲜货">鲜货</option>'
		            +'<option value ="干货">干货</option>'
		            +'</select></th>'
		            +'<td>0</td></tr>'
		            );
		 $('#tablea').unbind();
		 $('#tablea').editableTableWidget();
		}else{
			alert("请先点击 单品编码编辑");
		}
	});
	 //提交
	$('#fbt4').click(function(){
		 var  temp1Arr="";//缓存td 2个一组。
		 var  temp2Arr="";//缓存input复选框的值，1个一组    id,新增司机id值等于a99999。  
		 var  temp3Arr="";//缓存下拉列表框默认值		 
		   $('#tablea').find("td").each(function(){
			   var temp=$(this).text();
			   temp1Arr=temp1Arr+temp+",";				  
			   });//缓存td
	       $('#tablea').find("input").each(function(){	    	  
	    	   var temp=$(this).val();	    	  
			   temp2Arr=temp2Arr+temp+",";
	    	   }); //缓存input复选框的值，
	       $('#tablea').find("select").each(function(){    	  
		       var temp=$(this).val();			    	   
			   temp3Arr=temp3Arr+temp+",";
		       }); //缓存select下拉列表值，
	       
	    	var temp1=temp1Arr.slice(0,temp1Arr.length-1);//去掉最后一个 逗号 ，
	    	var temp2=temp2Arr.slice(0,temp2Arr.length-1);//去掉最后一个 逗号 ，
	    	var temp3=temp3Arr.slice(0,temp3Arr.length-1);//去掉最后一个 逗号 ，	
	    	
	    	//console.log(temp1);
	    	//console.log(temp2);
	    	//console.log(temp3);
	    	
	    	$.post("/phpwmscm/admin.php/Admin/Log/tjajaxsjtj/",
	    		    { 
	    		      arr1:temp1,
	    		      arr2:temp2,	
	    		      arr3:temp3,
	    		      user:$('#userbeifn').text()
	    		    },
	    		    function(data,status){
	    		    	 $('#tablea').remove();
	    		    	//console.log(data);//配合 var_dump 可以实现对ajax 处理过程的监控。    		    	
	    		    	
	    		    });	 
	    	
	    	alert("提交完成");    	
	});	
</script>
</body>
</html>